Skip to content

Conversation

@smockle
Copy link
Collaborator

@smockle smockle commented Oct 30, 2025

Fixes https://github.com/github/continuous-ai-for-accessibility/issues/87 (Hubber access only)
Fixes https://github.com/github/continuous-ai-for-accessibility/issues/81 (Hubber access only)

Problem

uses: github/accessibility-scanner@main currently fails with the following error—

Error: Can't find 'action.yml', 'action.yaml' or 'Dockerfile' under '/home/runner/work/accessibility-sandbox/accessibility-sandbox/.github/actions/gh-cache/cache'. Did you forget to run actions/checkout before running your local action?

—this PR makes it work.

Solution

This PR basically moves the preparatory cp workflow step we used to require into the composite action(s) itself.

This PR is a superior alternative to c262469:

  1. It restores our ability to merge main directly into v2, which simplifies backports (e.g. dependency updates that Dependabot opens for main).
  2. It means referencing a point release (e.g. uses: github/[email protected]) only runs code from that release (rather than a mix of v2.4.0 and (newer) v2 code).

Testing

@smockle smockle requested a review from a team as a code owner October 30, 2025 14:38
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the action reference mechanism to enable nested composite actions to reference sub-actions. Instead of using relative paths like ./.github/actions/..., the actions are now copied to a centralized location (/home/runner/work/_actions/current/.github/actions/) and referenced via ./../../_actions/current/.github/actions/....

  • Added setup steps to copy sub-actions to a centralized location using rsync
  • Updated all action references from relative ./.github/actions/ paths to ./../../_actions/current/.github/actions/
  • Changed quote style for consistency in one default value

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
action.yml Added sub-action setup step and updated all 6 action references to use the centralized path
.github/actions/gh-cache/cache/action.yml Added sub-action setup step and updated 2 action references, plus a quote style consistency fix

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +47 to +49
mkdir -p /home/runner/work/_actions/current/.github/actions
rsync -a .github/actions/ /home/runner/work/_actions/current/.github/actions/
ls -ltra /home/runner/work/_actions/current/.github/actions
Copy link

Copilot AI Oct 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hardcoded absolute path /home/runner/work/_actions/current/ assumes a specific runner directory structure that may not be portable across different environments or runner types (e.g., self-hosted runners). Consider using a relative path or environment variable like $RUNNER_TEMP to make this more portable.

Suggested change
mkdir -p /home/runner/work/_actions/current/.github/actions
rsync -a .github/actions/ /home/runner/work/_actions/current/.github/actions/
ls -ltra /home/runner/work/_actions/current/.github/actions
mkdir -p "${{ github.action_path }}/.github/actions"
rsync -a .github/actions/ "${{ github.action_path }}/.github/actions/"
ls -ltra "${{ github.action_path }}/.github/actions"

Copilot uses AI. Check for mistakes.
Comment on lines +31 to +32
mkdir -p /home/runner/work/_actions/current/.github/actions
rsync -a ../../../../.github/actions/ /home/runner/work/_actions/current/.github/actions/
Copy link

Copilot AI Oct 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hardcoded absolute path /home/runner/work/_actions/current/ assumes a specific runner directory structure that may not be portable across different environments or runner types (e.g., self-hosted runners). Consider using a relative path or environment variable like $RUNNER_TEMP to make this more portable.

Copilot uses AI. Check for mistakes.
@smockle smockle enabled auto-merge October 30, 2025 15:22
@smockle smockle merged commit 472bf85 into main Oct 30, 2025
11 of 12 checks passed
@smockle smockle deleted the smockle/restore-relative-paths branch October 30, 2025 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants